import java.util.*;

public class Program {

    private String text;
    private List statements;

    private void parseStatements() {
	statements.clear();
	int position = 0;
	while (position < text.length()) {
	    Statement statement = new Statement(text, position);
	    statements.add(statement);
	    position = statement.getEntire().getEnd() + 1;
	}
    }

    public Program() {
	text = new String();
	statements = new ArrayList();
    }

    public void setText(String txt) {
	text = txt;
	parseStatements();
    }

    public String getText() {
	return text;
    }

    public Iterator getStatements() {
	return statements.iterator();
    }

}  // public class Program

